import request from '@/request'

const API = {
  userInfo: '/api/personal/categoryList',
  otherInfo: '/api/pub/fragmentInfo',
  edit: '/api/personal/edit_info',
  Nav: '/api/sos_log/navigation'
}

/**获取用户信息 */
export const fetchUserInfo = () => request({ url: API.userInfo })

/**修改用户信息 */
export const editUserInfo = data => request({ url: API.edit, data })

/**
 * @param {number} id ID of the other
 * @returns {Promise<any>}
 */
export const fetchOtherInfo = id =>
  request({ url: API.otherInfo, data: { id } })

export const postNav = data => request({ url: API.Nav, data })
